# Maintainer: BlackEagle <ike.devolder@gmail.com>>

pkgname=kodi-addon-visualization-shadertoy
epoch=1
pkgver=20.3.0
_codename=Nexus
pkgrel=6
pkgdesc="Shadertoy visualizer for Kodi"
arch=('loong64' 'x86_64')
url='https://github.com/xbmc/visualization.shadertoy'
license=('GPL')
groups=('kodi-addons' 'kodi-addons-visualization')
makedepends=('cmake' 'p8-platform' 'glm' 'jsoncpp' 'kodi-dev')
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::https://github.com/xbmc/visualization.shadertoy/archive/$pkgver-$_codename.tar.gz")
sha512sums=('e2521ec3298630c67cd4f3991a2b3120e48fd62e17b84ed1f0266c587583c0a3372abbbc85bf03448a713ddc6eb61668782babd01dec5267cb7a97ec887b6be0')

build() {
    cd "visualization.shadertoy-$pkgver-$_codename"
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=1 \
        -DUSE_LTO=1 \
        .
    make
}

package() {
    depends=('kodi' 'p8-platform' 'glm' 'jsoncpp')
    cd "visualization.shadertoy-$pkgver-$_codename"
    make DESTDIR="$pkgdir/" install
}

